<template>
  <div>
    <van-nav-bar title="我的俱乐部" left-arrow fixed @click-left="onClickLeft"></van-nav-bar>
    <div class="content">
        <div v-for="item in clubData" :key="item.id">
        <ClubCard :data="item"></ClubCard>
        </div>
    </div>

  </div>
</template>
<script>
import ClubCard from '@/components/ClubCard.vue'
export default {
  name: 'mymaster',
  mounted () {
    this.$axios
      .get('/api/lists/mod/fans/', {
        params: {
          SessionID: sessionStorage.sessionid,
          userid: sessionStorage.userid,
          fans_type: 2
        }
      })
      .then(response => {
        this.clubData = response.data
        this.clubData.forEach(element => {
          console.log('this.element :', element)
          element.club_name = element.name
        })
      })
  },
  data () {
    return {
      clubData: []
    }
  },
  components: {
    ClubCard
  },
  methods: {
    onClickLeft () {
      this.$root.$router.go(-1)
    }
  }
}
</script>
<style scoped>
.content{
    margin-top: 50px;
}
</style>
